#pragma once
#include "DXAMLCommon.h"
//#include "XamlSchemaContext.h"
#include "XamlTypeNamespaceToken.h"
//#include "XamlAssembly.h"

class XamlAssembly;
class XamlProperty;
class XamlSchemaContext;

#include "XamlNamespace.h"

class XamlTypeNamespace :
	public XamlNamespace,
	xenable_shared_from_this<XamlTypeNamespace>

{
private: 
	XamlTypeNamespace(const xshared_ptr<XamlSchemaContext> & inXamlSchemaContext, const xshared_ptr<CXString> & inTypeNamespaceString, const struct XamlTypeNamespaceToken inTypeNamespaceToken, const xshared_ptr<XamlAssembly> & inOwningAssembly);
	XamlTypeNamespace();
public: 
	static HRESULT Create(const xshared_ptr<XamlSchemaContext> & inXamlSchemaContext, const xshared_ptr<CXString> & inTypeNamespaceString, const struct XamlTypeNamespaceToken inTypeNamespaceToken, const xshared_ptr<XamlAssembly> & inOwningAssembly, xshared_ptr<XamlTypeNamespace> & outXamlTypeNamespace);
	virtual HRESULT get_IsResolved(unsigned int * pOut);
	virtual HRESULT GetXamlType(const xshared_ptr<CXString> & inTypeName, xshared_ptr<XamlType> & outType);
	virtual HRESULT GetDirectiveType(const xshared_ptr<CXString> & inTypeName, xshared_ptr<XamlType> & outType);
	virtual HRESULT GetDirectiveProperty(const xshared_ptr<CXString> & inPropertyName, xshared_ptr<XamlProperty> & ppOut);
	HRESULT GetOwningAssembly(xshared_ptr<XamlAssembly> & outOwningAssembly);
	const struct XamlTypeNamespaceToken & get_TypeNamespaceToken();
protected: 
	virtual HRESULT get_TargetNamespaceCore(xshared_ptr<CXString> & outTargetNamespace);
	virtual HRESULT set_TargetNamespaceCore(const xshared_ptr<CXString> & inTargetNamespace);
	HRESULT GetSchemaContext(xshared_ptr<XamlSchemaContext> & outSchemaContext);
private: 
	HRESULT GetTypeInfoProviderKind(enum XamlTypeInfoProviderKind & outTypeInfoProviderKind);


private: 
	xweak_ptr<XamlSchemaContext> m_spXamlSchemaContext; 
	struct XamlTypeNamespaceToken m_XamlTypeNamespaceToken;
	xweak_ptr<XamlAssembly> m_spOwningAssembly; 
	xshared_ptr<CXString> m_spTypeNamespaceString; 
};


